home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1996 July / Macworld (1996-07).dmg / For your System Folder / Sound Manager 3.2a2 / SoundComponents.a < prev    next >
Text File  |  1995-11-24  |  17KB  |  644 lines

  1. ;
  2. ;    File:        SoundComponents.a
  3. ;
  4. ;    Contains:    Sound Components Interfaces.
  5. ;
  6. ;    Version:    ETO
  7. ;
  8. ;    DRI:        Jim Reekes
  9. ;
  10. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  11. ;                All rights reserved.
  12. ;
  13. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14. ;                stack.  Include the file and version information (from above)
  15. ;                in the problem description and send to:
  16. ;                    Internet:    apple.bugs@applelink.apple.com
  17. ;                    AppleLink:    APPLE.BUGS
  18. ;
  19. ;
  20.  
  21.     IF &TYPE('__SOUNDCOMPONENTS__') = 'UNDEFINED' THEN
  22. __SOUNDCOMPONENTS__ SET 1
  23.  
  24.  
  25.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  26.     include 'Types.a'
  27.     ENDIF
  28. ;        include 'ConditionalMacros.a'                                ;
  29.  
  30.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  31.     include 'Components.a'
  32.     ENDIF
  33. ;        include 'MixedMode.a'                                        ;
  34.  
  35.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  36.     include 'Sound.a'
  37.     ENDIF
  38. ;
  39. ;                        * * *  N O T E  * * *
  40. ;
  41. ;    This file has been updated to include Sound Manager 3.1 interfaces.
  42. ;
  43. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  44. ;    that originally shipped with the PowerMacs. These missing functions and the
  45. ;    new 3.1 interfaces have been released in the SoundLib library for PowerPC
  46. ;    developers to link with. The runtime library for these functions are
  47. ;    installed by Sound Manager 3.1. The following functions are found in SoundLib.
  48. ;
  49. ;        AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  50. ;        AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  51. ;        AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  52. ;        OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  53. ;        SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  54. ;        SoundComponentInitOutputDevice, SoundComponentPauseSource,
  55. ;        SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  56. ;        SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  57. ;        SoundComponentStartSource, SoundComponentStopSource
  58. ;
  59. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. ; constants
  61. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62.  
  63. ;sound component set/get info selectors
  64. siVolume                        EQU        'volu'
  65. siHardwareVolume                EQU        'hvol'
  66. siSpeakerVolume                    EQU        'svol'
  67. siHeadphoneVolume                EQU        'pvol'
  68. siHardwareVolumeSteps            EQU        'hstp'
  69. siHeadphoneVolumeSteps            EQU        'hdst'
  70. siHardwareMute                    EQU        'hmut'
  71. siSpeakerMute                    EQU        'smut'
  72. siHeadphoneMute                    EQU        'pmut'
  73. siRateMultiplier                EQU        'rmul'
  74. siQuality                        EQU        'qual'
  75. siWideStereo                    EQU        'wide'
  76. ;format types
  77. kOffsetBinary                    EQU        'raw '
  78. kTwosComplement                    EQU        'twos'
  79. kMACE3Compression                EQU        'MAC3'
  80. kMACE6Compression                EQU        'MAC6'
  81.  
  82. ;quality flags
  83. ;use interpolation in rate conversion
  84. kBestQuality                    EQU        (1 << 0)
  85.  
  86. ;useful bit masks
  87. kInputMask                        EQU        $000000FF            ;masks off input bits
  88. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  89. kOutputShift                    EQU        8                    ;amount output bits are shifted
  90. kActionMask                        EQU        $00FF0000            ;masks off action bits
  91. kSoundComponentBits                EQU        $00FFFFFF
  92.  
  93. ;SoundComponentPlaySourceBuffer action flags
  94. kSourcePaused                    EQU        (1 << 0)
  95. kPassThrough                    EQU        (1 << 16)
  96. kNoSoundComponentChain            EQU        (1 << 17)
  97. ;flags for OpenMixerSoundComponent
  98. kNoMixing                        EQU        (1 << 0)            ;don't mix source
  99. kNoSampleRateConversion            EQU        (1 << 1)            ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  100. kNoSampleSizeConversion            EQU        (1 << 2)            ;don't convert sample size (i.e. 16 -> 8)
  101. kNoSampleFormatConversion        EQU        (1 << 3)            ;don't convert sample format (i.e. 'twos' -> 'raw ')
  102. kNoChannelConversion            EQU        (1 << 4)            ;don't convert stereo/mono
  103. kNoDecompression                EQU        (1 << 5)            ;don't decompress (i.e. 'MAC3' -> 'raw ')
  104. kNoVolumeConversion                EQU        (1 << 6)            ;don't apply volume
  105. kNoRealtimeProcessing            EQU        (1 << 7)            ;won't run at interrupt time
  106.  
  107. ;Audio Component constants
  108. ;Values for whichChannel parameter
  109. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  110. audioLeftChannel                EQU        1                    ;Left channel
  111. audioRightChannel                EQU        2                    ;Right channel
  112. ;Values for mute parameter
  113. audioUnmuted                    EQU        0                    ;Device is unmuted
  114. audioMuted                        EQU        1                    ;Device is muted
  115. ;Capabilities flags definitions
  116. audioDoesMono                    EQU        (1 << 0)            ;Device supports mono output
  117. audioDoesStereo                    EQU        (1 << 1)            ;Device supports stereo output
  118. audioDoesIndependentChannels    EQU        (1 << 2)            ;Device supports independent software control of each channel
  119.  
  120. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. ; typedefs
  122. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. ;ShortFixed consists of an 8 bit, 2's complement integer part in the high byte,
  124. ;with an 8 bit fractional part in the low byte; its range is -128 to 127.99609375
  125. ; typedef short             ShortFixed
  126.  
  127. ; typedef struct SoundParamBlock  SoundParamBlock
  128. ; typedef SoundParamBlock     *SoundParamBlockPtr
  129. SoundParamBlock         RECORD    0
  130. recordSize                 ds.l   1        ; offset: $0 (0)        ;size of this record in bytes
  131. desc                     ds     SoundComponentData ; offset: $4 (4) ;description of sound buffer
  132. rateMultiplier             ds.l   1        ; offset: $20 (32)        ;rate multiplier to apply to sound
  133. leftVolume                 ds.w   1        ; offset: $24 (36)        ;volumes to apply to sound
  134. rightVolume                 ds.w   1        ; offset: $26 (38)
  135. quality                     ds.l   1        ; offset: $28 (40)        ;quality to apply to sound
  136. filter                     ds.l   1        ; offset: $2C (44)        ;filter to apply to sound
  137. moreRtn                     ds.l   1        ; offset: $30 (48)        ;routine to call to get more data
  138. completionRtn             ds.l   1        ; offset: $34 (52)        ;routine to call when buffer is complete
  139. refCon                     ds.l   1        ; offset: $38 (56)        ;user refcon
  140. result                     ds.w   1        ; offset: $3C (60)        ;result
  141. sizeof                     EQU *            ; size:   $3E (62)
  142.                         ENDR
  143.  
  144. ; typedef void                 *SoundSource
  145. AudioInfo                 RECORD    0
  146. capabilitiesFlags         ds.l   1        ; offset: $0 (0)        ;Describes device capabilities
  147. reserved                 ds.l   1        ; offset: $4 (4)        ;Reserved by Apple
  148. numVolumeSteps             ds.w   1        ; offset: $8 (8)        ;Number of significant increments between min and max volume
  149. sizeof                     EQU *            ; size:   $A (10)
  150.                         ENDR
  151.  
  152. ; typedef struct AudioInfo     AudioInfo
  153. ; typedef AudioInfo         *AudioInfoPtr
  154. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155. ; functions for sound components
  156. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  157. ;Sound Component dispatch selectors
  158.  
  159. ;these calls cannot be delegated
  160. kSoundComponentInitOutputDeviceSelect EQU        1
  161. kSoundComponentSetSourceSelect    EQU        2
  162. kSoundComponentGetSourceSelect    EQU        3
  163. kSoundComponentGetSourceDataSelect EQU        4
  164. kSoundComponentSetOutputSelect    EQU        5
  165. kDelegatedSoundComponentSelectors EQU        $0100                ;first selector that can be delegated up the chain
  166. ;these calls can be delegated and have own range
  167. kSoundComponentAddSourceSelect    EQU        kDelegatedSoundComponentSelectors + 1
  168. kSoundComponentRemoveSourceSelect EQU        kDelegatedSoundComponentSelectors + 2
  169. kSoundComponentGetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 3
  170. kSoundComponentSetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 4
  171. kSoundComponentStartSourceSelect EQU        kDelegatedSoundComponentSelectors + 5
  172. kSoundComponentStopSourceSelect    EQU        kDelegatedSoundComponentSelectors + 6
  173. kSoundComponentPauseSourceSelect EQU        kDelegatedSoundComponentSelectors + 7
  174. kSoundComponentPlaySourceBufferSelect EQU        kDelegatedSoundComponentSelectors + 8
  175.  
  176. ;Audio Component selectors
  177. kAudioGetVolumeSelect            EQU        0
  178. kAudioSetVolumeSelect            EQU        1
  179. kAudioGetMuteSelect                EQU        2
  180. kAudioSetMuteSelect                EQU        3
  181. kAudioSetToDefaultsSelect        EQU        4
  182. kAudioGetInfoSelect                EQU        5
  183. kAudioGetBassSelect                EQU        6
  184. kAudioSetBassSelect                EQU        7
  185. kAudioGetTrebleSelect            EQU        8
  186. kAudioSetTrebleSelect            EQU        9
  187. kAudioGetOutputDeviceSelect        EQU        10
  188. kAudioMuteOnEventSelect            EQU        129
  189.  
  190. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  191. ; Sound Manager 3.0 utilities
  192. ;
  193. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  194. ;
  195.     IF ¬ GENERATINGCFM THEN
  196.         Macro
  197.         _OpenMixerSoundComponent
  198.             dc.w     $203C
  199.             dc.w     $0614
  200.             dc.w     $0018
  201.             dc.w     $A800
  202.         EndM
  203.     ELSE
  204.         IMPORT_CFM_FUNCTION    OpenMixerSoundComponent
  205.     ENDIF
  206.  
  207. ;
  208. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  209. ;
  210.     IF ¬ GENERATINGCFM THEN
  211.         Macro
  212.         _CloseMixerSoundComponent
  213.             dc.w     $203C
  214.             dc.w     $0218
  215.             dc.w     $0018
  216.             dc.w     $A800
  217.         EndM
  218.     ELSE
  219.         IMPORT_CFM_FUNCTION    CloseMixerSoundComponent
  220.     ENDIF
  221.  
  222. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223. ; basic sound component functions
  224. ;
  225. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  226. ;
  227.     IF ¬ GENERATINGCFM THEN
  228.         Macro
  229.         _SoundComponentInitOutputDevice
  230.             dc.w     $2F3C
  231.             dc.w     $0004
  232.             dc.w     $0001
  233.             moveq    #0,d0
  234.             dc.w     $A82A
  235.         EndM
  236.     ELSE
  237.         IMPORT_CFM_FUNCTION    SoundComponentInitOutputDevice
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  242. ;
  243.     IF ¬ GENERATINGCFM THEN
  244.         Macro
  245.         _SoundComponentSetSource
  246.             dc.w     $2F3C
  247.             dc.w     $0008
  248.             dc.w     $0002
  249.             moveq    #0,d0
  250.             dc.w     $A82A
  251.         EndM
  252.     ELSE
  253.         IMPORT_CFM_FUNCTION    SoundComponentSetSource
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  258. ;
  259.     IF ¬ GENERATINGCFM THEN
  260.         Macro
  261.         _SoundComponentGetSource
  262.             dc.w     $2F3C
  263.             dc.w     $0008
  264.             dc.w     $0003
  265.             moveq    #0,d0
  266.             dc.w     $A82A
  267.         EndM
  268.     ELSE
  269.         IMPORT_CFM_FUNCTION    SoundComponentGetSource
  270.     ENDIF
  271.  
  272. ;
  273. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  274. ;
  275.     IF ¬ GENERATINGCFM THEN
  276.         Macro
  277.         _SoundComponentGetSourceData
  278.             dc.w     $2F3C
  279.             dc.w     $0004
  280.             dc.w     $0004
  281.             moveq    #0,d0
  282.             dc.w     $A82A
  283.         EndM
  284.     ELSE
  285.         IMPORT_CFM_FUNCTION    SoundComponentGetSourceData
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  290. ;
  291.     IF ¬ GENERATINGCFM THEN
  292.         Macro
  293.         _SoundComponentSetOutput
  294.             dc.w     $2F3C
  295.             dc.w     $0008
  296.             dc.w     $0005
  297.             moveq    #0,d0
  298.             dc.w     $A82A
  299.         EndM
  300.     ELSE
  301.         IMPORT_CFM_FUNCTION    SoundComponentSetOutput
  302.     ENDIF
  303.  
  304. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  305. ; junction methods for the mixer, must be called at non-interrupt level
  306. ;
  307. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  308. ;
  309.     IF ¬ GENERATINGCFM THEN
  310.         Macro
  311.         _SoundComponentAddSource
  312.             dc.w     $2F3C
  313.             dc.w     $0004
  314.             dc.w     $0101
  315.             moveq    #0,d0
  316.             dc.w     $A82A
  317.         EndM
  318.     ELSE
  319.         IMPORT_CFM_FUNCTION    SoundComponentAddSource
  320.     ENDIF
  321.  
  322. ;
  323. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  324. ;
  325.     IF ¬ GENERATINGCFM THEN
  326.         Macro
  327.         _SoundComponentRemoveSource
  328.             dc.w     $2F3C
  329.             dc.w     $0004
  330.             dc.w     $0102
  331.             moveq    #0,d0
  332.             dc.w     $A82A
  333.         EndM
  334.     ELSE
  335.         IMPORT_CFM_FUNCTION    SoundComponentRemoveSource
  336.     ENDIF
  337.  
  338. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. ; info methods
  340. ;
  341. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  342. ;
  343.     IF ¬ GENERATINGCFM THEN
  344.         Macro
  345.         _SoundComponentGetInfo
  346.             dc.w     $2F3C
  347.             dc.w     $000C
  348.             dc.w     $0103
  349.             moveq    #0,d0
  350.             dc.w     $A82A
  351.         EndM
  352.     ELSE
  353.         IMPORT_CFM_FUNCTION    SoundComponentGetInfo
  354.     ENDIF
  355.  
  356. ;
  357. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  358. ;
  359.     IF ¬ GENERATINGCFM THEN
  360.         Macro
  361.         _SoundComponentSetInfo
  362.             dc.w     $2F3C
  363.             dc.w     $000C
  364.             dc.w     $0104
  365.             moveq    #0,d0
  366.             dc.w     $A82A
  367.         EndM
  368.     ELSE
  369.         IMPORT_CFM_FUNCTION    SoundComponentSetInfo
  370.     ENDIF
  371.  
  372. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  373. ; control methods
  374. ;
  375. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  376. ;
  377.     IF ¬ GENERATINGCFM THEN
  378.         Macro
  379.         _SoundComponentStartSource
  380.             dc.w     $2F3C
  381.             dc.w     $0006
  382.             dc.w     $0105
  383.             moveq    #0,d0
  384.             dc.w     $A82A
  385.         EndM
  386.     ELSE
  387.         IMPORT_CFM_FUNCTION    SoundComponentStartSource
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  392. ;
  393.     IF ¬ GENERATINGCFM THEN
  394.         Macro
  395.         _SoundComponentStopSource
  396.             dc.w     $2F3C
  397.             dc.w     $0006
  398.             dc.w     $0106
  399.             moveq    #0,d0
  400.             dc.w     $A82A
  401.         EndM
  402.     ELSE
  403.         IMPORT_CFM_FUNCTION    SoundComponentStopSource
  404.     ENDIF
  405.  
  406. ;
  407. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  408. ;
  409.     IF ¬ GENERATINGCFM THEN
  410.         Macro
  411.         _SoundComponentPauseSource
  412.             dc.w     $2F3C
  413.             dc.w     $0006
  414.             dc.w     $0107
  415.             moveq    #0,d0
  416.             dc.w     $A82A
  417.         EndM
  418.     ELSE
  419.         IMPORT_CFM_FUNCTION    SoundComponentPauseSource
  420.     ENDIF
  421.  
  422. ;
  423. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  424. ;
  425.     IF ¬ GENERATINGCFM THEN
  426.         Macro
  427.         _SoundComponentPlaySourceBuffer
  428.             dc.w     $2F3C
  429.             dc.w     $000C
  430.             dc.w     $0108
  431.             moveq    #0,d0
  432.             dc.w     $A82A
  433.         EndM
  434.     ELSE
  435.         IMPORT_CFM_FUNCTION    SoundComponentPlaySourceBuffer
  436.     ENDIF
  437.  
  438. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  439. ; interface for Audio Components
  440. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  441. ;Volume is described as a value between 0 and 1, with 0 indicating minimum
  442. ;  volume and 1 indicating maximum volume; if the device doesn't support
  443. ;  software control of volume, then a value of unimpErr is returned, indicating
  444. ;  that these functions are not supported by the device
  445. ;
  446. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  447. ;
  448.     IF ¬ GENERATINGCFM THEN
  449.         Macro
  450.         _AudioGetVolume
  451.             dc.w     $2F3C
  452.             dc.w     $0006
  453.             dc.w     $0000
  454.             moveq    #0,d0
  455.             dc.w     $A82A
  456.         EndM
  457.     ELSE
  458.         IMPORT_CFM_FUNCTION    AudioGetVolume
  459.     ENDIF
  460.  
  461. ;
  462. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  463. ;
  464.     IF ¬ GENERATINGCFM THEN
  465.         Macro
  466.         _AudioSetVolume
  467.             dc.w     $2F3C
  468.             dc.w     $0004
  469.             dc.w     $0001
  470.             moveq    #0,d0
  471.             dc.w     $A82A
  472.         EndM
  473.     ELSE
  474.         IMPORT_CFM_FUNCTION    AudioSetVolume
  475.     ENDIF
  476.  
  477. ;If the device doesn't support software control of mute, then a value of unimpErr is
  478. ;returned, indicating that these functions are not supported by the device
  479. ;
  480. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  481. ;
  482.     IF ¬ GENERATINGCFM THEN
  483.         Macro
  484.         _AudioGetMute
  485.             dc.w     $2F3C
  486.             dc.w     $0006
  487.             dc.w     $0002
  488.             moveq    #0,d0
  489.             dc.w     $A82A
  490.         EndM
  491.     ELSE
  492.         IMPORT_CFM_FUNCTION    AudioGetMute
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  497. ;
  498.     IF ¬ GENERATINGCFM THEN
  499.         Macro
  500.         _AudioSetMute
  501.             dc.w     $2F3C
  502.             dc.w     $0004
  503.             dc.w     $0003
  504.             moveq    #0,d0
  505.             dc.w     $A82A
  506.         EndM
  507.     ELSE
  508.         IMPORT_CFM_FUNCTION    AudioSetMute
  509.     ENDIF
  510.  
  511. ;AudioSetToDefaults causes the associated device to reset its volume and mute values
  512. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  513. ;
  514. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  515. ;
  516.     IF ¬ GENERATINGCFM THEN
  517.         Macro
  518.         _AudioSetToDefaults
  519.             dc.w     $2F3C
  520.             dc.w     $0000
  521.             dc.w     $0004
  522.             moveq    #0,d0
  523.             dc.w     $A82A
  524.         EndM
  525.     ELSE
  526.         IMPORT_CFM_FUNCTION    AudioSetToDefaults
  527.     ENDIF
  528.  
  529. ;This routine is required; it must be implemented by all audio components
  530. ;
  531. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  532. ;
  533.     IF ¬ GENERATINGCFM THEN
  534.         Macro
  535.         _AudioGetInfo
  536.             dc.w     $2F3C
  537.             dc.w     $0004
  538.             dc.w     $0005
  539.             moveq    #0,d0
  540.             dc.w     $A82A
  541.         EndM
  542.     ELSE
  543.         IMPORT_CFM_FUNCTION    AudioGetInfo
  544.     ENDIF
  545.  
  546. ;
  547. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  548. ;
  549.     IF ¬ GENERATINGCFM THEN
  550.         Macro
  551.         _AudioGetBass
  552.             dc.w     $2F3C
  553.             dc.w     $0006
  554.             dc.w     $0006
  555.             moveq    #0,d0
  556.             dc.w     $A82A
  557.         EndM
  558.     ELSE
  559.         IMPORT_CFM_FUNCTION    AudioGetBass
  560.     ENDIF
  561.  
  562. ;
  563. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  564. ;
  565.     IF ¬ GENERATINGCFM THEN
  566.         Macro
  567.         _AudioSetBass
  568.             dc.w     $2F3C
  569.             dc.w     $0004
  570.             dc.w     $0007
  571.             moveq    #0,d0
  572.             dc.w     $A82A
  573.         EndM
  574.     ELSE
  575.         IMPORT_CFM_FUNCTION    AudioSetBass
  576.     ENDIF
  577.  
  578. ;
  579. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  580. ;
  581.     IF ¬ GENERATINGCFM THEN
  582.         Macro
  583.         _AudioGetTreble
  584.             dc.w     $2F3C
  585.             dc.w     $0006
  586.             dc.w     $0008
  587.             moveq    #0,d0
  588.             dc.w     $A82A
  589.         EndM
  590.     ELSE
  591.         IMPORT_CFM_FUNCTION    AudioGetTreble
  592.     ENDIF
  593.  
  594. ;
  595. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  596. ;
  597.     IF ¬ GENERATINGCFM THEN
  598.         Macro
  599.         _AudioSetTreble
  600.             dc.w     $2F3C
  601.             dc.w     $0004
  602.             dc.w     $0009
  603.             moveq    #0,d0
  604.             dc.w     $A82A
  605.         EndM
  606.     ELSE
  607.         IMPORT_CFM_FUNCTION    AudioSetTreble
  608.     ENDIF
  609.  
  610. ;
  611. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  612. ;
  613.     IF ¬ GENERATINGCFM THEN
  614.         Macro
  615.         _AudioGetOutputDevice
  616.             dc.w     $2F3C
  617.             dc.w     $0004
  618.             dc.w     $000A
  619.             moveq    #0,d0
  620.             dc.w     $A82A
  621.         EndM
  622.     ELSE
  623.         IMPORT_CFM_FUNCTION    AudioGetOutputDevice
  624.     ENDIF
  625.  
  626. ;This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  627. ;
  628. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  629. ;
  630.     IF ¬ GENERATINGCFM THEN
  631.         Macro
  632.         _AudioMuteOnEvent
  633.             dc.w     $2F3C
  634.             dc.w     $0002
  635.             dc.w     $0081
  636.             moveq    #0,d0
  637.             dc.w     $A82A
  638.         EndM
  639.     ELSE
  640.         IMPORT_CFM_FUNCTION    AudioMuteOnEvent
  641.     ENDIF
  642.  
  643.     ENDIF ; __SOUNDCOMPONENTS__
  644.